import { createApp } from 'vue'
import '@/styles/index.scss'

import App from '@/App.vue'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'virtual:svg-icons-register'
import globalComponents from './components'
import router from './router'
import Store from './store'
import './permisstion.ts'
import 'element-plus/theme-chalk/dark/css-vars.css'
//引入自定义指令文件
import { isHasButton } from '@/directive/has'
const app = createApp(App)

const title = import.meta.env.VITE_APP_TITLE || '商品甄选运营平台'
document.getElementById('app-title')!.innerText = title

app.use(ElementPlus, {
  locale: zhCn,
})
app.use(router)
app.use(Store)

isHasButton(app)
app.use(globalComponents)
console.log('env', import.meta.env.NODE_ENV) // 打印环境变量
console.log('title', import.meta.env.VITE_APP_TITLE) // 打印自定义环境变量
app.mount('#app')
